/*    */ package com.feeyin.radar.sys.dao.impl;
/*    */ 
/*    */ import com.feeyin.radar.commons.StringUtils;
/*    */ import com.feeyin.radar.sys.dao.CountryDAO;
/*    */ import com.feeyin.radar.sys.model.Country;
/*    */ import java.util.List;
/*    */ import org.springframework.orm.ibatis.SqlMapClientTemplate;
/*    */ import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
/*    */ 
/*    */ public class CountryDAOImpl extends SqlMapClientDaoSupport
/*    */   implements CountryDAO
/*    */ {
/*    */   public List getCountrysByParentId(Integer parentId)
/*    */   {
/* 20 */     return getSqlMapClientTemplate().queryForList("getCountrysByParentId", parentId);
/*    */   }
/*    */ 
/*    */   public List getCountrysByLevel(Integer level) {
/* 24 */     return getSqlMapClientTemplate().queryForList("getCountrysByLevel", level);
/*    */   }
/*    */ 
/*    */   public List getCountrysByParentIdAndCName(Country country) {
/* 28 */     return getSqlMapClientTemplate().queryForList("getCountrysByParentIdAndCName", country);
/*    */   }
/*    */ 
/*    */   public Country getCountryByCode(String code) {
/* 32 */     if (StringUtils.isEmpty(code)) return null;
/* 33 */     return (Country)getSqlMapClientTemplate().queryForObject("getCountryByCode", code);
/*    */   }
/*    */ 
/*    */   public boolean insertCountry(Country country) {
/* 37 */     if (country == null) return false;
/* 38 */     if (StringUtils.isEmpty(country.getCode())) return false;
/* 39 */     Integer result = (Integer)getSqlMapClientTemplate().insert("insertCountry", country);
/* 40 */     return getCountryByCode(country.getCode()) != null;
/*    */   }
/*    */ 
/*    */   public boolean deleteCountry(Integer id)
/*    */   {
/* 46 */     Integer result = Integer.valueOf(getSqlMapClientTemplate().delete("deleteCountry", id));
/* 47 */     return result != null;
/*    */   }
/*    */ }

/* Location:           C:\Users\e547415\MyProject\rone\WEB-INF\classes\
 * Qualified Name:     com.feeyin.radar.sys.dao.impl.CountryDAOImpl
 * JD-Core Version:    0.6.0
 */